home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / olectnrs.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  15.1 KB  |  369 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'OleCtnrs.pas' rev: 3.00
  6.  
  7. #ifndef OleCtnrsHPP
  8. #define OleCtnrsHPP
  9. #include <ComObj.hpp>
  10. #include <Graphics.hpp>
  11. #include <Menus.hpp>
  12. #include <Forms.hpp>
  13. #include <Controls.hpp>
  14. #include <Classes.hpp>
  15. #include <SysUtils.hpp>
  16. #include <OleDlg.hpp>
  17. #include <ActiveX.hpp>
  18. #include <Commctrl.hpp>
  19. #include <Messages.hpp>
  20. #include <Windows.hpp>
  21. #include <SysInit.hpp>
  22. #include <System.hpp>
  23.  
  24. //-- user supplied -----------------------------------------------------------
  25. #include <DocObj.h>
  26.  
  27. namespace Olectnrs
  28. {
  29. //-- type declarations -------------------------------------------------------
  30. __interface IVCLFrameForm;
  31. typedef System::DelphiInterface<IVCLFrameForm> _di_IVCLFrameForm;
  32. class DELPHICLASS TOleContainer;
  33. __interface IVCLFrameForm : public IOleInPlaceFrame /* __guid="{CD02E1C0-52DA-11D0-9EA6-0020AF3D82DA}" */
  34.     
  35. {
  36.     
  37. public:
  38.     virtual void __fastcall AddContainer(TOleContainer* Instance) = 0;
  39.     virtual void __fastcall RemoveContainer(TOleContainer* Instance) = 0;
  40.     virtual void __fastcall ClearBorderSpace(void) = 0;
  41.     virtual Forms::TCustomForm* __fastcall Form(void) = 0;
  42. };
  43.  
  44. enum TAutoActivate { aaManual, aaGetFocus, aaDoubleClick };
  45.  
  46. enum TSizeMode { smClip, smCenter, smScale, smStretch, smAutoSize };
  47.  
  48. enum TObjectState { osEmpty, osLoaded, osRunning, osOpen, osInPlaceActive, osUIActive };
  49.  
  50. enum TCreateType { ctNewObject, ctFromFile, ctLinkToFile, ctFromData, ctLinkFromData };
  51.  
  52. struct TCreateInfo
  53. {
  54.     TCreateType CreateType;
  55.     bool ShowAsIcon;
  56.     int IconMetaPict;
  57.     GUID ClassID;
  58.     System::WideString FileName;
  59.     _di_IDataObject DataObject;
  60. } ;
  61.  
  62. struct TVerbInfo
  63. {
  64.     short Verb;
  65.     Word Flags;
  66. } ;
  67.  
  68. typedef void __fastcall (__closure *TObjectMoveEvent)(TOleContainer* OleContainer, const Windows::TRect 
  69.     &Bounds);
  70.  
  71. class PASCALIMPLEMENTATION TOleContainer : public Controls::TCustomControl 
  72. {
  73.     typedef Controls::TCustomControl inherited;
  74.     
  75. private:
  76.     void *__IUnknown;    /* IUnknown */
  77.     void *__IOleClientSite;    /* IOleClientSite */
  78.     void *__IOleInPlaceSite;    /* IOleInPlaceSite */
  79.     void *__IAdviseSink;    /* IAdviseSink */
  80.     void *__IOleDocumentSite;    /* IOleDocumentSite */
  81.     void *__iOleUIObjInfo;    /* Oledlg::iOleUIObjInfo */
  82.     
  83. public:
  84.     operator iOleUIObjInfo*(void) { return (iOleUIObjInfo*)&__iOleUIObjInfo; }
  85.     operator IOleDocumentSite*(void) { return (IOleDocumentSite*)&__IOleDocumentSite; }
  86.     operator IAdviseSink*(void) { return (IAdviseSink*)&__IAdviseSink; }
  87.     operator IOleInPlaceSite*(void) { return (IOleInPlaceSite*)&__IOleInPlaceSite; }
  88.     operator IOleClientSite*(void) { return (IOleClientSite*)&__IOleClientSite; }
  89.     operator IUnknown*(void) { return (IUnknown*)&__IUnknown; }
  90.     
  91. private:
  92.     int FRefCount;
  93.     _di_ILockBytes FLockBytes;
  94.     _di_IStorage FStorage;
  95.     _di_IOleObject FOleObject;
  96.     int FDrawAspect;
  97.     tagPOINT FViewSize;
  98.     Classes::TStringList* FObjectVerbs;
  99.     int FDataConnection;
  100.     _di_IVCLFrameForm FDocForm;
  101.     _di_IVCLFrameForm FFrameForm;
  102.     _di_IOleInPlaceObject FOleInPlaceObject;
  103.     _di_IOleInPlaceActiveObject FOleInPlaceActiveObject;
  104.     HACCEL FAccelTable;
  105.     int FAccelCount;
  106.     Menus::TPopupMenu* FPopupVerbMenu;
  107.     bool FAllowInPlace;
  108.     bool FAllowActiveDoc;
  109.     TAutoActivate FAutoActivate;
  110.     bool FAutoVerbMenu;
  111.     TFormBorderStyle FBorderStyle;
  112.     bool FCopyOnSave;
  113.     bool FOldStreamFormat;
  114.     TSizeMode FSizeMode;
  115.     bool FObjectOpen;
  116.     bool FUIActive;
  117.     bool FModified;
  118.     bool FModSinceSave;
  119.     bool FFocused;
  120.     bool FNewInserted;
  121.     Classes::TNotifyEvent FOnActivate;
  122.     Classes::TNotifyEvent FOnDeactivate;
  123.     TObjectMoveEvent FOnObjectMove;
  124.     Classes::TNotifyEvent FOnResize;
  125.     _di_IOleDocumentView FDocView;
  126.     bool FDocObj;
  127.     HIDESBASE HRESULT __stdcall QueryInterface(const GUID &IID, /* out */ void *Obj);
  128.     HIDESBASE int __stdcall _AddRef(void);
  129.     HIDESBASE int __stdcall _Release(void);
  130.     HRESULT __stdcall SaveObject(void);
  131.     HRESULT __stdcall GetMoniker(int dwAssign, int dwWhichMoniker, /* out */ _di_IMoniker &mk);
  132.     HRESULT __stdcall GetContainer(/* out */ _di_IOleContainer &container);
  133.     HRESULT __stdcall ShowObject(void);
  134.     HRESULT __stdcall OnShowWindow(BOOL fShow);
  135.     HRESULT __stdcall RequestNewObjectLayout(void);
  136.     HRESULT __stdcall ContextSensitiveHelp(BOOL fEnterMode);
  137.     HRESULT __stdcall GetWindow(/* out */ HWND &wnd);
  138.     HRESULT __stdcall CanInPlaceActivate(void);
  139.     HRESULT __stdcall OnInPlaceActivate(void);
  140.     HRESULT __stdcall OnUIActivate(void);
  141.     HRESULT __stdcall GetWindowContext(/* out */ _di_IOleInPlaceFrame &frame, /* out */ _di_IOleInPlaceUIWindow 
  142.         &doc, /* out */ Windows::TRect &rcPosRect, /* out */ Windows::TRect &rcClipRect, /* out */ tagOIFI 
  143.         &frameInfo);
  144.     HRESULT __stdcall Scroll(const tagPOINT scrollExtent);
  145.     HRESULT __stdcall OnUIDeactivate(BOOL fUndoable);
  146.     HRESULT __stdcall OnInPlaceDeactivate(void);
  147.     HRESULT __stdcall DiscardUndoState(void);
  148.     HRESULT __stdcall DeactivateAndUndo(void);
  149.     HRESULT __stdcall OnPosRectChange(const Windows::TRect &rcPosRect);
  150.     void __stdcall OnDataChange(const tagFORMATETC &formatetc, const tagSTGMEDIUM &stgmed);
  151.     void __stdcall OnViewChange(int dwAspect, int lindex);
  152.     void __stdcall OnRename(const _di_IMoniker mk);
  153.     void __stdcall OnSave(void);
  154.     void __stdcall OnClose(void);
  155.     HRESULT __stdcall ActivateMe(_di_IOleDocumentView View);
  156.     HRESULT __stdcall GetObjectInfo(int dwObject, int &dwObjSize, char * &lpszLabel, char * &lpszType, 
  157.         char * &lpszShortType, char * &lpszLocation);
  158.     HRESULT __stdcall GetConvertInfo(int dwObject, GUID &ClassID, Word &wFormat, GUID &ConvertDefaultClassID
  159.         , System::PGUID &lpClsidExclude, int &cClsidExclude);
  160.     HRESULT __stdcall ConvertObject(int dwObject, const GUID &clsidNew);
  161.     HRESULT __stdcall GetViewInfo(int dwObject, int &hMetaPict, int &dvAspect, int &nCurrentScale);
  162.     HRESULT __stdcall SetViewInfo(int dwObject, int hMetaPict, int dvAspect, int nCurrentScale, BOOL bRelativeToOrig
  163.         );
  164.     void __fastcall AdjustBounds(void);
  165.     void __fastcall CheckObject(void);
  166.     void __fastcall CreateAccelTable(void);
  167.     void __fastcall CreateStorage(void);
  168.     void __fastcall DesignModified(void);
  169.     void __fastcall DestroyAccelTable(void);
  170.     void __fastcall DestroyVerbs(void);
  171.     int __fastcall GetBorderWidth(void);
  172.     bool __fastcall GetCanPaste(void);
  173.     bool __fastcall GetIconic(void);
  174.     bool __fastcall GetLinked(void);
  175.     int __fastcall GetObjectDataSize(void);
  176.     Classes::TStrings* __fastcall GetObjectVerbs(void);
  177.     System::AnsiString __fastcall GetOleClassName(void);
  178.     System::Variant __fastcall GetOleObject(void);
  179.     int __fastcall GetPrimaryVerb(void);
  180.     System::AnsiString __fastcall GetSourceDoc(void);
  181.     TObjectState __fastcall GetState(void);
  182.     void __fastcall InitObject(void);
  183.     void __fastcall ObjectMoved(const Windows::TRect &ObjectRect);
  184.     void __fastcall PopupVerbMenuClick(System::TObject* Sender);
  185.     void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
  186.     void __fastcall SetDrawAspect(bool Iconic, int IconMetaPict);
  187.     void __fastcall SetFocused(bool Value);
  188.     void __fastcall SetIconic(bool Value);
  189.     void __fastcall SetSizeMode(TSizeMode Value);
  190.     void __fastcall SetUIActive(bool Active);
  191.     void __fastcall SetViewAdviseSink(bool Enable);
  192.     void __fastcall UpdateObjectRect(void);
  193.     void __fastcall UpdateView(void);
  194.     HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
  195.     MESSAGE void __fastcall CMDocWindowActivate(Messages::TMessage &Message);
  196.     MESSAGE void __fastcall CMUIDeactivate(Messages::TMessage &Message);
  197.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMSetFocus &Message);
  198.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  199.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  200.     HIDESBASE MESSAGE void __fastcall WMWindowPosChanged(Messages::TWMWindowPosMsg &Message);
  201.     
  202. protected:
  203.     HIDESBASEDYNAMIC void __fastcall Changed(void);
  204.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  205.     DYNAMIC void __fastcall DblClick(void);
  206.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  207.     DYNAMIC void __fastcall DoEnter(void);
  208.     DYNAMIC Menus::TPopupMenu* __fastcall GetPopupMenu(void);
  209.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  210.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  211.         int Y);
  212.     virtual void __fastcall Paint(void);
  213.     
  214. public:
  215.     __fastcall virtual TOleContainer(Classes::TComponent* AOwner);
  216.     __fastcall virtual ~TOleContainer(void);
  217.     bool __fastcall ChangeIconDialog(void);
  218.     void __fastcall Close(void);
  219.     void __fastcall Copy(void);
  220.     void __fastcall CreateLinkToFile(const System::AnsiString FileName, bool Iconic);
  221.     void __fastcall CreateObject(const System::AnsiString OleClassName, bool Iconic);
  222.     void __fastcall CreateObjectFromFile(const System::AnsiString FileName, bool Iconic);
  223.     void __fastcall CreateObjectFromInfo(const TCreateInfo &CreateInfo);
  224.     void __fastcall DestroyObject(void);
  225.     void __fastcall DoVerb(int Verb);
  226.     int __fastcall GetIconMetaPict(void);
  227.     bool __fastcall InsertObjectDialog(void);
  228.     void __fastcall LoadFromFile(const System::AnsiString FileName);
  229.     void __fastcall LoadFromStream(Classes::TStream* Stream);
  230.     bool __fastcall ObjectPropertiesDialog(void);
  231.     void __fastcall Paste(void);
  232.     bool __fastcall PasteSpecialDialog(void);
  233.     void __fastcall Run(void);
  234.     void __fastcall SaveAsDocument(const System::AnsiString FileName);
  235.     void __fastcall SaveToFile(const System::AnsiString FileName);
  236.     void __fastcall SaveToStream(Classes::TStream* Stream);
  237.     void __fastcall UpdateObject(void);
  238.     void __fastcall UpdateVerbs(void);
  239.     __property bool CanPaste = {read=GetCanPaste, nodefault};
  240.     __property bool Linked = {read=GetLinked, nodefault};
  241.     __property bool Modified = {read=FModified, write=FModified, nodefault};
  242.     __property bool NewInserted = {read=FNewInserted, nodefault};
  243.     __property Classes::TStrings* ObjectVerbs = {read=GetObjectVerbs};
  244.     __property System::AnsiString OleClassName = {read=GetOleClassName};
  245.     __property System::Variant OleObject = {read=GetOleObject};
  246.     __property _di_IOleObject OleObjectInterface = {read=FOleObject};
  247.     __property int PrimaryVerb = {read=GetPrimaryVerb, nodefault};
  248.     __property System::AnsiString SourceDoc = {read=GetSourceDoc};
  249.     __property TObjectState State = {read=GetState, nodefault};
  250.     __property _di_IStorage StorageInterface = {read=FStorage};
  251.     
  252. __published:
  253.     __property bool AllowInPlace = {read=FAllowInPlace, write=FAllowInPlace, default=1};
  254.     __property bool AllowActiveDoc = {read=FAllowActiveDoc, write=FAllowActiveDoc, default=1};
  255.     __property TAutoActivate AutoActivate = {read=FAutoActivate, write=FAutoActivate, default=2};
  256.     __property bool AutoVerbMenu = {read=FAutoVerbMenu, write=FAutoVerbMenu, default=1};
  257.     __property Align ;
  258.     __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
  259.     __property Caption ;
  260.     __property Color ;
  261.     __property bool CopyOnSave = {read=FCopyOnSave, write=FCopyOnSave, default=1};
  262.     __property Ctl3D ;
  263.     __property DragCursor ;
  264.     __property DragMode ;
  265.     __property Enabled ;
  266.     __property bool Iconic = {read=GetIconic, write=SetIconic, stored=false, nodefault};
  267.     __property bool OldStreamFormat = {read=FOldStreamFormat, write=FOldStreamFormat, default=0};
  268.     __property ParentColor ;
  269.     __property ParentCtl3D ;
  270.     __property ParentShowHint ;
  271.     __property PopupMenu ;
  272.     __property ShowHint ;
  273.     __property TSizeMode SizeMode = {read=FSizeMode, write=SetSizeMode, default=0};
  274.     __property TabOrder ;
  275.     __property TabStop ;
  276.     __property Visible ;
  277.     __property Classes::TNotifyEvent OnActivate = {read=FOnActivate, write=FOnActivate};
  278.     __property Classes::TNotifyEvent OnDeactivate = {read=FOnDeactivate, write=FOnDeactivate};
  279.     __property OnDragDrop ;
  280.     __property OnDragOver ;
  281.     __property OnEndDrag ;
  282.     __property OnEnter ;
  283.     __property OnExit ;
  284.     __property OnMouseDown ;
  285.     __property OnMouseMove ;
  286.     __property OnMouseUp ;
  287.     __property OnKeyDown ;
  288.     __property OnKeyPress ;
  289.     __property OnKeyUp ;
  290.     __property TObjectMoveEvent OnObjectMove = {read=FOnObjectMove, write=FOnObjectMove};
  291.     __property Classes::TNotifyEvent OnResize = {read=FOnResize, write=FOnResize};
  292.     __property OnStartDrag ;
  293. public:
  294.     /* TWinControl.CreateParented */ __fastcall TOleContainer(HWND ParentWindow) : Controls::TCustomControl(
  295.         ParentWindow) { }
  296.     
  297. };
  298.  
  299. class DELPHICLASS TOleForm;
  300. class PASCALIMPLEMENTATION TOleForm : public System::TInterfacedObject 
  301. {
  302.     typedef System::TInterfacedObject inherited;
  303.     
  304. private:
  305.     void *__IOleForm;    /* Forms::IOleForm */
  306.     void *__IOleWindow;    /* IOleWindow */
  307.     void *__IOleInPlaceUIWindow;    /* IOleInPlaceUIWindow */
  308.     void *__IOleInPlaceFrame;    /* IOleInPlaceFrame */
  309.     void *__IVCLFrameForm;    /* Olectnrs::IVCLFrameForm */
  310.     
  311. public:
  312.     operator IVCLFrameForm*(void) { return (IVCLFrameForm*)&__IVCLFrameForm; }
  313.     operator IOleInPlaceFrame*(void) { return (IOleInPlaceFrame*)&__IOleInPlaceFrame; }
  314.     operator IOleInPlaceUIWindow*(void) { return (IOleInPlaceUIWindow*)&__IOleInPlaceUIWindow; }
  315.     operator IOleWindow*(void) { return (IOleWindow*)&__IOleWindow; }
  316.     operator IOleForm*(void) { return (IOleForm*)&__IOleForm; }
  317.     
  318. private:
  319.     Forms::TCustomForm* FForm;
  320.     Classes::TList* FContainers;
  321.     _di_IOleInPlaceActiveObject FActiveObject;
  322.     int FSaveWidth;
  323.     int FSaveHeight;
  324.     Classes::TList* FHiddenControls;
  325.     Controls::TControl* FSpacers[4];
  326.     void __fastcall OnDestroy(void);
  327.     void __fastcall OnResize(void);
  328.     HRESULT __stdcall GetWindow(/* out */ HWND &wnd);
  329.     HRESULT __stdcall ContextSensitiveHelp(BOOL fEnterMode);
  330.     HRESULT __stdcall GetBorder(/* out */ Windows::TRect &BorderRect);
  331.     HRESULT __stdcall RequestBorderSpace(const Windows::TRect &borderwidths);
  332.     HRESULT __stdcall SetBorderSpace(Windows::PRect pborderwidths);
  333.     HRESULT __stdcall SetActiveObject(const _di_IOleInPlaceActiveObject ActiveObject, wchar_t * pszObjName
  334.         );
  335.     HRESULT __stdcall InsertMenus(HMENU hmenuShared, tagOleMenuGroupWidths &menuWidths);
  336.     HRESULT __stdcall SetMenu(HMENU hmenuShared, HMENU holemenu, HWND hwndActiveObject);
  337.     HRESULT __stdcall RemoveMenus(HMENU hmenuShared);
  338.     HRESULT __stdcall SetStatusText(wchar_t * pszStatusText);
  339.     HRESULT __stdcall EnableModeless(BOOL fEnable);
  340.     HRESULT __stdcall TranslateAccelerator(tagMSG &msg, Word wID);
  341.     void __fastcall AddContainer(TOleContainer* Instance);
  342.     void __fastcall RemoveContainer(TOleContainer* Instance);
  343.     Forms::TCustomForm* __fastcall Form(void);
  344.     void __fastcall ClearBorderSpace(void);
  345.     bool __fastcall IsSpacer(Controls::TControl* Control);
  346.     bool __fastcall IsToolControl(Controls::TControl* Control);
  347.     
  348. public:
  349.     __fastcall TOleForm(Forms::TCustomForm* Form);
  350.     __fastcall virtual ~TOleForm(void);
  351. };
  352.  
  353. //-- var, const, procedure ---------------------------------------------------
  354. #define ovShow (Shortint)(-1)
  355. #define ovOpen (Shortint)(-2)
  356. #define ovHide (Shortint)(-3)
  357. #define ovUIActivate (Shortint)(-4)
  358. #define ovInPlaceActivate (Shortint)(-5)
  359. #define ovDiscardUndoState (Shortint)(-6)
  360. #define ovPrimary (int)(-65536)
  361. extern PACKAGE void __fastcall DestroyMetaPict(int MetaPict);
  362.  
  363. }    /* namespace Olectnrs */
  364. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  365. using namespace Olectnrs;
  366. #endif
  367. //-- end unit ----------------------------------------------------------------
  368. #endif    // OleCtnrs
  369.